<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>选择器计算面试题解析</title>
    <style>
        /*  
         ul.shopping-list li .highlight  =>  span
         ul.shopping-list li .highlight:nth-of-type(odd)  => span:nth-of-type(odd)  => span
        */

        /* 1 + 10 + 1 + 10 = 22  */
        ul.shopping-list li .highlight {color: red;}

        /* 1+ 10 + 1 + 10 + 10 = 32 */
        ul.shopping-list li .highlight:nth-of-type(odd) {color: blue;}
    </style>
</head>

<body>
    <ul class="shopping-list" id="awesome">
        <li><span>Milk</span></li>
        <li class="favorite" id="must-buy"><span class="highlight">Sausage</span></li>
    </ul>
</body>

</html>